#!/bin/sh
ROOT_DIR=/home/jensenzhang/workspace/ilovebtweb/crawler
cd $ROOT_DIR

echo `date` | tee -a fetch_cli.log
echo "begin fetch new items" | tee -a fetch_cli.log
php yyets.php | tee -a fetch_cli.log 2>&1
res=$?
if [ $res = 0 ]; then
  sleep 1
  echo "begin import new items to DB" | tee -a fetch_cli.log
  php importDB.php | tee -a fetch_cli.log 2>&1
fi
echo "DONE~~~~" | tee -a fetch_cli.log
echo "" | tee -a fetch_cli.log
